home *** CD-ROM | disk | FTP | other *** search
/ Amiga Collections: Franz PD / Franz PD Disk #334 (1994-06)(Rhein-Sieg-Soft).zip / Franz PD Disk #334 (1994-06)(Rhein-Sieg-Soft).adf / ASo-Tools / Sources / FlushFonts.asm < prev    next >
Assembly Source File  |  1994-04-02  |  6KB  |  181 lines

  1. ;* $Revision Header built automatically *************** (do not edit) ************
  2. ;*
  3. ;* © Copyright by (none)
  4. ;*
  5. ;* File             : FlushFonts.asm
  6. ;* Created on       : Saturday, 02.04.94 16:15:37
  7. ;* Created by       : Arnold Schommer
  8. ;* Current revision : V1.3
  9. ;*
  10. ;*
  11. ;* Purpose
  12. ;* -------
  13. ;*   - removes all fonts from the memory, that are no more in use
  14. ;*
  15. ;* Revision V1.3
  16. ;* --------------
  17. ;* created on Friday, 18.06.93 16:32:38  by  Arnold Schommer.   LogMessage :
  18. ;*  -*-  changed on Saturday, 02.04.94 16:17:32  by  Arnold Schommer.   LogMessage :
  19. ;*   - converted DICE -> A68k
  20. ;*  -*-  created on Friday, 18.06.93 16:32:38  by  Arnold Schommer.     LogMessage :
  21. ;*   - works, but i had to use Graphics.StripFont(), what is not
  22. ;*     documented in the RKRM Autodocs & Includes. i used
  23. ;*     StripFont() on a NOT opened font. maybe this causes, maybe
  24. ;*     this avoids trouble. who (but cbm) knows ?
  25. ;*
  26. ;* Revision V1.2
  27. ;* --------------
  28. ;* created on Friday, 18.06.93 16:02:13  by  Arnold Schommer.   LogMessage :
  29. ;*   - also recognises TE0B_NOREMFONT
  30. ;*
  31. ;* Revision V1.1
  32. ;* --------------
  33. ;* created on Thursday, 17.06.93 23:50:31  by  Arnold Schommer.   LogMessage :
  34. ;*   - program runs, but fonts don't get removed.
  35. ;*     the fault seems to be in Graphics.RemFont(). as far as i
  36. ;*     understand, the TE0B_NOREMFONT is found set - but not by me !
  37. ;*     seems to be a strange feature of OpenDiskFont().
  38. ;*
  39. ;* Revision V1.0
  40. ;* --------------
  41. ;* created on Thursday, 17.06.93 22:34:41  by  Arnold Schommer.   LogMessage :
  42. ;*     --- Initial release ---
  43. ;*
  44. ;*********************************************************************************
  45. REVISION  MACRO
  46.           dc.b "1.3"
  47.           ENDM
  48. REVDATE   MACRO
  49.           dc.b "02.04.94"
  50.           ENDM
  51. REVTIME   MACRO
  52.           dc.b "16:17:32"
  53.           ENDM
  54. AUTHOR    MACRO
  55.           dc.b "Arnold Schommer"
  56.           ENDM
  57. VERNUM    EQU  1
  58. REVNUM    EQU  0
  59. ****************************************************************************
  60.         NOLIST
  61.         INCLUDE "exec/LVO.i"
  62.         INCLUDE "dos/LVO.i"
  63.         INCLUDE "dos/dosextens.i"
  64.         INCLUDE "graphics/LVO.i"
  65.         INCLUDE "exec/lists.i"
  66.         INCLUDE "exec/ports.i"
  67.         INCLUDE "graphics/gfxbase.i"
  68.         INCLUDE "graphics/text.i"
  69.         LIST
  70. ****************************************************************************
  71.  
  72. ;Register-Variablen:
  73.  
  74. _GfxBase:       EQUR d7
  75. _DOSBase:       EQUR d6
  76. _ExecBase:      EQUR a5
  77. WBMsg:          EQUR d5
  78. _Output:        EQUR d4
  79. to_remove:      EQUR a4
  80. current:        EQUR a3
  81.  
  82. ****************************************************************************
  83.  
  84.         SECTION prg,CODE
  85.  
  86. ;Library-Namen kopieren:
  87. _main:  move.l  _AbsExecBase,_ExecBase
  88.         moveq   #0,WBMsg
  89.         moveq   #RETURN_FAIL,d3
  90.         move.l  WBMsg,a1        ;a1=0->eigener Task
  91.         move.l  _ExecBase,a6
  92.         CALL    FindTask        ;Wo darf man denn nachschauen ?
  93.         move.l  d0,a4
  94.         tst.l   pr_CLI(a4)      ;von CLI oder WB aus gestartet ?
  95.         bne     fromCLI
  96. ;von WB aus:
  97.         lea     pr_MsgPort(a4),a0
  98.         CALL    WaitPort        ;auf Start-Message warten
  99.         lea     pr_MsgPort(a4),a0
  100.         CALL    GetMsg          ;muß nachher beantwortet werden
  101.         move.l  d0,WBMsg
  102. ;Libraries öffnen:
  103. fromCLI: OPENLIB DosName(pc)
  104.         move.l  d0,_DOSBase
  105.         beq     ende
  106.         CALLDOS Output
  107.         move.l  d0,_Output
  108.         OPENLIB GfxName(pc)
  109.         beq     CloseDos
  110.         move.l  d0,_GfxBase
  111. ****************************************************************************
  112. ;das eigentliche Programm:
  113.         move.l  _GfxBase,a0
  114.         move.l  gb_TextFonts+LH_HEAD(a0),current
  115. loop:   move.l  LN_SUCC(current),d0
  116.         beq     endofmain
  117.         move.l  current,to_remove
  118.         move.l  d0,current
  119.         move.l  LN_NAME(to_remove),a0
  120.         bsr     puts
  121.         btst.b  #FPB_DISKFONT,tf_Flags(to_remove)
  122.         bne     2$
  123.         lea     no_df(pc),a0
  124.         bra     comment
  125. 2$:     tst.w   tf_Accessors(to_remove)
  126.         beq     remove
  127.         lea     used(pc),a0
  128.         bra     comment
  129. remove: move.l  _GfxBase,a6
  130.         cmp.w   #36,LIB_VERSION(a6)
  131.         blt     1$
  132.         move.l  to_remove,a0
  133.         CALL    StripFont
  134. 1$:     move.l  to_remove,a1
  135.         CALL    RemFont
  136.         lea     removed(pc),a0
  137. comment: bsr    puts
  138.         bra     loop
  139. ****************************************************************************
  140. endofmain:
  141.         moveq   #RETURN_OK,d3   ;alles ok
  142. ;die Libraries schließen
  143.         CLOSELIB _GfxBase
  144. CloseDos: CLOSELIB _DOSBase
  145. ;und wieder zurück
  146. ende:   tst.l   WBMsg           ;war da was ?
  147.         beq     toCLI           ;na dann halt nicht
  148. ;Message zur WB zurück
  149.         move.l  _ExecBase,a6
  150.         CALL    Forbid
  151.         move.l  WBMsg,a1
  152.         CALL    ReplyMsg
  153. toCLI:  move.l  d3,d0           ;gab's Fehler ?
  154.         rts
  155. ****************************************************************************
  156. ;Unterroutine: 0terminierten String ausgeben:
  157. puts:   move.l  _DOSBase,a6
  158.         move.l  _Output,d1
  159.         move.l  a0,d2
  160. 1$:     tst.b   (a0)+
  161.         bne     1$
  162.         move.l  a0,d3
  163.         sub.l   d2,d3
  164.         subq.l  #1,d3
  165.         JUMP    Write
  166. ****************************************************************************
  167. ;Versions-String
  168.         dc.b    "$VER: FlushFonts "
  169.         REVISION
  170.         dc.b    " ("
  171.         REVDATE
  172.         dc.b    ")",0
  173.  
  174. DosName:        DOSNAME
  175. GfxName:        GFXNAME
  176. no_df:          dc.b " is no DiskFont",10,0
  177. used:           dc.b " is still in use",10,0
  178. removed:        dc.b " gets removed",10,0
  179.  
  180.         END
  181.